Skip to content

Update to keyboard-types 0.8.3; migrate to NamedKey across platforms#214

Merged
prokopyl merged 5 commits into
RustAudio:nextfrom
waywardmonkeys:update-keyboard-events
Jun 23, 2026
Merged

Update to keyboard-types 0.8.3; migrate to NamedKey across platforms#214
prokopyl merged 5 commits into
RustAudio:nextfrom
waywardmonkeys:update-keyboard-events

Conversation

@waywardmonkeys

Copy link
Copy Markdown
  • Replace deprecated Key::<Variant> usages with Key::Named(NamedKey::<Variant>)
  • Map unidentified and dead keys to Key::Named(NamedKey::Unidentified) and Key::Named(NamedKey::Dead)
  • Keep Key::Character(String) for printable characters
  • Update platform keymaps (macOS, X11, Windows) to 0.8 API

keyboard-types 0.8 moved non-character keys into NamedKey. This adapts the platform mappings to the new API, aligning emitted KeyboardEvent.key with the spec-compliant representation.

Comment thread src/platform/macos/keyboard.rs Outdated
@waywardmonkeys

Copy link
Copy Markdown
Author

I built this on macOS, but I don't use baseview myself, so didn't test it beyond that.

I have a family of crates ui-events and wanted to do a ui-events-baseview adapter and having everyone on the same version of keyboard-types (the current one) would make that easier, so I figured I'd give this a shot.

timboudreau added a commit to timboudreau/baseview that referenced this pull request Dec 10, 2025
RustAudio#214
from branch 'update-keyboard-events' of github.com:waywardmonkeys/baseview
@timboudreau

Copy link
Copy Markdown

FYI, I am working on making the UI framework floem support baseview, as described here.

It would be helpful if this could be integrated, as it is very helpful for compatibility, and it would be more likely for the patches to be accepted if they don't require my fork of baseview.

@micahrj micahrj enabled auto-merge (squash) December 11, 2025 05:28
@micahrj

micahrj commented Dec 11, 2025

Copy link
Copy Markdown
Member

Looks like there's one remaining place that needs to be updated in the X11 backend (Key::Delete).

- Replace deprecated `Key::<Variant>` usages with `Key::Named(NamedKey::<Variant>)`
- Map unidentified and dead keys to `Key::Named(NamedKey::Unidentified)` and `Key::Named(NamedKey::Dead)`
- Keep `Key::Character(String)` for printable characters
- Update platform keymaps (macOS, X11, Windows) to 0.8 API

keyboard-types 0.8 moved non-character keys into `NamedKey`. This adapts the
platform mappings to the new API, aligning emitted `KeyboardEvent.key` with
the spec-compliant representation.
@prokopyl prokopyl force-pushed the update-keyboard-events branch from be7ab2e to 0c0c44f Compare June 22, 2026 23:54
@prokopyl

Copy link
Copy Markdown
Member

I made the few mentioned fixes, as well as fixing it for our MSRV.

It's all good now, thank you very much for your PR! 🙂

@prokopyl prokopyl merged commit e12abac into RustAudio:next Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants